#!/usr/bin/env bash
# export GOPATH 之后 go build 之前
# shellcheck disable=SC2154,SC2206

# pre-compile 钩子调用
${buildpack}/hooks/run_hook "pre-compile" "${build}" "bin/pre-compile"

# 读取 /tmp/environment/GO_INSTLL_ARGS
if [ -f "${env_dir}/GO_INSTLL_ARGS" ]; then
    GO_INSTLL_ARGS=$(cat "${env_dir}/GO_INSTLL_ARGS")
    export GO_INSTLL_ARGS
fi

# 剔除 -tags heroku
FLAGS=(${GO_INSTLL_ARGS} ${FLAGS[@]:2})